package com.xiaozhi.service.impl;


import com.xiaozhi.dao.KnowledgeTypeMapper;
import com.xiaozhi.entity.KnowledgeType;
import com.xiaozhi.service.IKnowledgeTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 知识库分类Service业务层处理
 *
 * @author zhaoyk
 * @date 2025-09-13
 */
@Service
public class KnowledgeTypeServiceImpl   implements IKnowledgeTypeService
{
    @Autowired
    private KnowledgeTypeMapper knowledgeTypeMapper;

    /**
     * 查询知识库分类
     *
     * @param id 知识库分类主键
     * @return 知识库分类
     */
    @Override
    public KnowledgeType selectKnowledgeTypeById(Long id)
    {
        return knowledgeTypeMapper.selectKnowledgeTypeById(id);
    }

    /**
     * 查询知识库分类列表
     *
     * @param knowledgeType 知识库分类
     * @return 知识库分类
     */
    @Override
    public List<KnowledgeType> selectKnowledgeTypeList(KnowledgeType knowledgeType)
    {
        return knowledgeTypeMapper.selectKnowledgeTypeList(knowledgeType);
    }

    /**
     * 新增知识库分类
     *
     * @param knowledgeType 知识库分类
     * @return 结果
     */
    @Override
    public int insertKnowledgeType(KnowledgeType knowledgeType)
    {

            return knowledgeTypeMapper.insertKnowledgeType(knowledgeType);
    }

    /**
     * 修改知识库分类
     *
     * @param knowledgeType 知识库分类
     * @return 结果
     */
    @Override
    public int updateKnowledgeType(KnowledgeType knowledgeType)
    {

        return knowledgeTypeMapper.updateKnowledgeType(knowledgeType);
    }

    /**
     * 批量删除知识库分类
     *
     * @param ids 需要删除的知识库分类主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeTypeByIds(Long[] ids)
    {
        return knowledgeTypeMapper.deleteKnowledgeTypeByIds(ids);
    }

    /**
     * 删除知识库分类信息
     *
     * @param id 知识库分类主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeTypeById(Long id)
    {
        return knowledgeTypeMapper.deleteKnowledgeTypeById(id);
    }
}
